<!--分页-->
<template>
  <div>
    <el-pagination
      :page-size.sync="pageSize"
      :total="Number(total)"
      :current-page.sync="curPage"
      style="margin-top: 8px;"
      hide-on-single-page
      layout="total, prev, pager, next, sizes"
      @size-change="sizeChange"
      @current-change="pageChange"
    />
  </div>

</template>
<script>

export default {
  props: {
    page: {
      required: true
    },
    pageSize: { required: true },
    total: { required: true }
  },
  data() {
    return {
      curPage: 1
    }
  },
  mounted() {
    this.curPage = this.page
  },
  methods: {
    sizeChange(e) {
      this.$emit('sizeChange', e)
    },
    pageChange(e) {
      this.curPage=e
      this.$emit('pageChange', e)
    }
  }
}
</script>
